# Maintainer: Wu Zhenyu <wuzy01@qq.com>
_realname=vivid

pkgbase=mingw-w64-$_realname
pkgname=$MINGW_PACKAGE_PREFIX-$_realname
pkgver=0.9.0
pkgrel=1
pkgdesc='A themeable LS_COLORS generator with a rich filetype datebase (mingw-w64)'
arch=(any)
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url='https://github.com/sharkdp/vivid'
makedepends=($MINGW_PACKAGE_PREFIX-rust)
license=(MIT Apache)
source=("$url/archive/v$pkgver.tar.gz")
sha256sums=('325f16df916e4192d56d589839be474801ffd3d6a105f4a1a033221570ff6b56')
b2sums=('6bae858a27d704ff73ded2560ae74f6821c97517c8e8e3f9058619cfdf11bd3bd626074978951adb07cd799dc032a509f7e0c7171d8c7c0996d1f423bd9d7bf8')

prepare() {
  cd vivid-$pkgver
  cargo fetch --locked
}

build() {
  cd vivid-$pkgver
  cargo build --release --locked --offline
}

package() {
  cd vivid-$pkgver
  install -Dt "$pkgdir"$MINGW_PREFIX/bin target/release/vivid
  install -Dm644 -t "$pkgdir"$MINGW_PREFIX/share/licenses/vivid LICENSE-MIT
}
